//********************************************************************************************/
// File Name: drv_i2c.h	
// Author:	Wood.Wang
// Date:
// Message:
// Copyright 2012,All right is reserved;	
//********************************************************************************************/
#ifndef  __DRV_I2C_H
#define  __DRV_I2C_H

#include "main.h"

//#define	 I2C_USE_GPIO

void drv_i2c_gpio_init( void );

uint8_t I2C_WriteByte(uint8_t index,uint8_t dev_addr, uint8_t addr,uint8_t Byte);
uint8_t I2C_ReadByte (uint8_t index,uint8_t dev_addr, uint8_t addr);

uint8_t I2C_PageWrite(uint8_t index,uint8_t dev_addr, uint8_t addr,uint8_t *str,uint32_t num);
uint8_t I2C_PageRead (uint8_t index,uint8_t dev_addr, uint8_t addr,uint8_t *str,uint32_t num);

uint8_t I2C_Write(uint8_t index,uint8_t dev_addr, uint8_t *cmd,uint32_t len,uint8_t *str,uint32_t num);
uint8_t I2C_Read (uint8_t index,uint8_t dev_addr, uint8_t *cmd,uint32_t len,uint8_t *str,uint32_t num);

uint8_t I2C_WriteOnly(uint8_t index,uint8_t dev_addr,uint8_t *str,uint32_t num);
uint8_t I2C_ReadOnly (uint8_t index,uint8_t dev_addr,uint8_t *str,uint32_t num);

#endif  //__DRV_I2C_H

